-
Notifications
You must be signed in to change notification settings - Fork 0
drivers: led: lp5569: implement write_channels api #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Since we are far far behind upstream main, the first commit didn't cherry-pick cleanly. But this is merely due to formatting. |
DmtKats
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets wait a bit for the upstream review. If you really need this now we can just merge
|
Upstream merged with minor changes - I think I'll just backport the relevant patches; maybe including the older stuff that reformatted code etc. |
This reverts commit 9aecff9. We ought to replace this bespoke patch with a direct cherry-pick from upstream main
This reverts commit d3b74c3. We ought to replace this bespoke patch with a direct cherry-pick from upstream main
The lp5569 controller contains an internal charge pump which can be useful
for driving LEDs with a forward voltage greater than the lp5569 supply.
Taking advantage of the charge pump can alleviate the need for an external
boost converter.
Add a dts property, charge-pump-mode, to the ti,lp5569 binding with which
the cp_mode bits of the MISC register will be configured.
Following the datasheet, the possible configurations are:
0x00 -> disabled (default)
0x01 -> 1x mode
0x10 -> 1.5x mode
0x11 -> auto mode
Signed-off-by: Emil Juhl <[email protected]>
(cherry picked from commit 47f9040)
The lp5569 features a double functioning pin for enable and pwm control. The chip, however, uses the first rising edge to initialize and get ready for i2c communication, and then the pin alters function to pwm mode. Add support for providing enable-gpios to the lp5569 in the dts, which will make sure to assert the pin and wait for the chip to initialize before attempting further configuration of the chip. Signed-off-by: Emil Juhl <[email protected]> (cherry picked from commit f53a401)
Run clang-format on drivers/led/lp5569.c to align formatting in the file. No functional changes intended. Signed-off-by: Emil Dahl Juhl <[email protected]> (cherry picked from commit bc5477a)
The lp5569 controller supports auto-increment for its registers. This is by default enabled in the chip, but the driver actively disabled it. Since auto-increment is useful for writing multiple consecutive registers, enable the feature. The driver, however, doesn't perform such consecutive writes and thus the existing behavior is not altered. Signed-off-by: Emil Dahl Juhl <[email protected]> (cherry picked from commit 45744b4)
The lp5569 has multiple pwm outputs, and thus implementing the write_channels api to set multiple values in a single call makes sense. Implement the write_channels function with a basic range check on the channel range. Since the lp5569 supports auto-increment, all of the channels can be written in one i2c transfer, starting from the pwm register of the start_channel. Signed-off-by: Emil Dahl Juhl <[email protected]> (cherry picked from commit d6ac9e8)
dfa70ba to
3da5718
Compare
|
@dkarnikis @DmtKats I now reverted our two bespoke patches for the lp5569 and cherry-picked the entire range of patches from upstream (up until the point of lp5569 write_channels). |
See commits.
Submitted for upstream: zephyrproject-rtos#81497